<template>
  <component v-if="designer.widget?.layout" :is="Layouts[designer.widget?.layout]" :designer="designer"></component>
</template>

<script setup lang="ts" name="RenderLayout">
import { defineAsyncComponent } from "vue";
import type { Component } from "vue";
defineProps({
  designer: {
    type: Object
  }
});
const Layouts: Record<String, Component> = {
  tableLayout: defineAsyncComponent(() => import("./Layout/TableLayout.vue")),
  dialogLayout: defineAsyncComponent(() => import("./Layout/DialogLayout.vue")),
  flowFormLayout: defineAsyncComponent(() => import("./Layout/FlowFormLayout.vue")),
  reportFormLayout: defineAsyncComponent(() => import("./Layout/ReportFormLayout.vue"))
};
</script>

<style scoped></style>
